<template>
  <a-modal :title="title" :width="1260" :visible="visible" :maskClosable="false" switchFullscreen @cancel="handleCancel">
    <template slot="footer">
      <a-button @click="handleCancel">{{$t('关闭')}}</a-button>
      
    </template>
    <div style="text-align: right">
      <a-button type="primary" v-print="'#printme'">{{$t('打印')}}</a-button>
    </div>
    <id id="printme" style="width: 1210px;height: 100%">
      <div>
        <div style="font-size: 18px; font-weight: 600; margin: 10px 0; text-align: center">{{ $t('场地报表') }}</div>
        <a-row>
          <a-col :span="14" style="color: #000;">{{$t('打印时间')}}:{{queryParam.bTime}}~{{queryParam.eTime}}</a-col>
          <a-col :span="10" style="color: #000;">{{$t('打印人')}}:{{nickname()}}</a-col>
        </a-row>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='1'})>-1 && equipmentCollectionDataSource.length > 0">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('设备收款汇总') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="equipmentCollectionColumns"
          :dataSource="equipmentCollectionDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='2'})>-1 && businessSummaryDataSource.length > 0">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('业务汇总') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="businessSummaryColumns"
          :dataSource="businessSummaryDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='3'})>-1 && goodsSalesDataSource.length > 1">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('商品销售兑换') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="goodsSalesColumns"
          :dataSource="goodsSalesDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='4'})>-1 && machineOnOffDataSource.length > 1">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('机台投币退票') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="machineOnOffColumns"
          :dataSource="machineOnOffDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow1"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='5'})>-1 && ticketProjectDataSource.length > 1">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('门票汇总') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="ticketProjectColumns"
          :dataSource="ticketProjectDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
      </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='6'})>-1 && balanceChangesDataSource.length > 0">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('会员余额变化') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="balanceChangesColumns"
          :dataSource="balanceChangesDataSource"
          :pagination="false"
          :loading="false"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='7'})>-1 && memberMealDataSource.length > 0">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('套餐汇总') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="memberMealColumns"
          :dataSource="memberMealDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='8'})>-1 && outCoinDataSource.length > 0">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('设备出币') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="outCoinColumns"
          :dataSource="outCoinDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='9'})>-1 && saveLotteryDataSource.length > 1">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('存票汇总') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="deviceId"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="saveLotteryColumns"
          :dataSource="saveLotteryDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='10'})>-1 && giftRecycleDataSource.length > 1">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('礼品回收') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="kindId"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="giftRecycleColumns"
          :dataSource="giftRecycleDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
      <div v-if="modules.findIndex(m=>{return m.value=='11'})>-1 && goodsKindDataSource.length > 1">
        <div style="font-weight: 600; margin: 10px 0">{{ $t('商品分类') }}</div>
        <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="kindId"
          class="j-table-force-nowrap"
          :scroll="{ x: true }"
          :columns="goodsKindColumns"
          :dataSource="goodsKindDataSource"
          :pagination="false"
          :loading="false"
          :customRow="customRow"
        >
        </a-table>
      </div>
    </id>
  </a-modal>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'SiteReportPrint',
  data(){
    return {
      title: this.$t("场地报表"),
      visible: false,
      queryParam: {},
      modules: [],
      equipmentCollectionColumns: [],
      equipmentCollectionDataSource: [],
      businessSummaryColumns: [
        {
          title: this.$t('业务类型'),
          align: 'center',
          dataIndex: 'typeId_dictText',
        },
        {
          title: this.$t('业务笔数'),
          align: 'center',
          dataIndex: 'count',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('金额'),
          align: 'center',
          dataIndex: 'cash',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('实币'),
          align: 'center',
          dataIndex: 'phyCoin',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
      ],
      businessSummaryDataSource: [],
      goodsSalesColumns: [
        {
          title: this.$t('商品名称'),
          align: 'center',
          dataIndex: 'goodsName',
          customRender: (t, r, i) => {
            if (!t) {
              t = this.$t('合计')
            }
            return t
          },
        },
        {
          title: this.$t('数量'),
          align: 'center',
          dataIndex: 'totalNum',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('销售金额'),
          align: 'center',
          dataIndex: 'sale',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
      ],
      goodsSalesDataSource: [],
      machineOnOffColumns: [
        {
          title: this.$t('项目名称'),
          align: 'center',
          dataIndex: 'gameId_dictText',
        },
        {
          title: this.$t('支付金额'),
          align: 'center',
          dataIndex: 'payAmount',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('卡投币'),
          align: 'center',
          dataIndex: 'memberCoin',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('投实币'),
          align: 'center',
          dataIndex: 'physicalCoin',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('总投币'),
          align: 'center',
          dataIndex: 'totalCoin',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('退票类型'),
          align: 'center',
          dataIndex: 'outputType_dictText',
        },
        {
          title: this.$t('退票值'),
          align: 'center',
          dataIndex: 'outputValue',
          customRender: (t, r, i) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
      ],
      machineOnOffDataSource: [],
      ticketProjectColumns:[
        {
          title: this.$t('项目名称'),
          align: 'center',
          dataIndex: 'goodsName',
          customRender: (t, r) => {
            if (t == '合计') {
              return this.$t(t)
            }
            return t
          },
        },
        {
          title: this.$t('销售数量'),
          align: 'center',
          dataIndex: 'saleNum',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
          customRender: (text, r) => {
            text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
            return text.toFixed(0);
          }
        },
        {
          title: this.$t('销售金额'),
          align: 'center',
          dataIndex: 'sale',
          customRender: (t) => {
            return t.toFixed(2)
          },
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('扣年月票张数'),
          align: 'center',
          dataIndex: 'deductNum',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
          customRender: (text, r) => {
            text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
            return text.toFixed(0);
          }
        },
      ],
      ticketProjectDataSource: [],
      balanceChangesColumns: [
        {
          title: '',
          align: 'center',
          dataIndex: 'name',
        },
        {
          title: this.$t('会员数量'),
          align: 'center',
          dataIndex: 'member',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
      ],
      balanceChangesDataSource: [],
      memberMealColumns: [{
        title: this.$t('商品名称'),
        align: 'center',
        dataIndex: 'goodsName',
        scopedSlots: { customRender: 'goodsName' },
        customCell: (r) => {
          if (r.goodsName == this.$t('合计')) {
            return {
              attrs: {
                colSpan: 2,
              },
            }
          }
          return {
            attrs: {
              colSpan: 1,
            },
          }
        },
      },
      {
        title: this.$t('套餐单价'),
        align: 'center',
        dataIndex: 'avgPrice',
        customRender: (text, row, index) => {
          if (row.goodsName != this.$t('合计')) {
            if (!text) {
              return 0.00;
            }
            return text.toFixed(2)
          }
          return {
            attrs: {
              colSpan: 0,
            },
          }
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('业务笔数'),
        align: 'center',
        dataIndex: 'count',
        customRender: (text, r) => {
          if (!text) {
            return 0;
          }
          return text.toFixed(0);
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('销售数量'),
        align: 'center',
        dataIndex: 'saleNum',
        customRender: (text, r) => {
          if (!text) {
            return 0;
          }
          return text.toFixed(0);
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('销售金额'),
        align: 'center',
        dataIndex: 'sale',
        customRender: (t) => {
          if (!t) {
            return 0.00;
          }
          return t.toFixed(2)
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('币值'),
        align: 'center',
        dataIndex: 'coin',
        customRender: (text, r) => {
          if (!text) {
            return 0;
          }
          return text.toFixed(0);
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('售币值'),
        align: 'center',
        dataIndex: 'saleCoin',
        customRender: (text, r) => {
          if (!text) {
            return 0;
          }
          return text.toFixed(0);
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('充币值'),
        align: 'center',
        dataIndex: 'rechargeCoin',
        customRender: (text, r) => {
          if (!text) {
            return 0;
          }
          return text.toFixed(0);
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      {
        title: this.$t('限时币'),
        align: 'center',
        dataIndex: 'limitCoin',
        customRender: (text, r) => {
          if(!text){
              return 0;
            }
          return text.toFixed(0);
        },
        customCell: (r, i) => {
          return {
            style: {
              textAlign: 'right',
            },
          }
        },
      },
      ],
      memberMealDataSource: [],
      outCoinColumns:[
        {
          title: this.$t('设备编码'),
          align: 'center',
          dataIndex: 'deviceId',
        },
        {
          title: this.$t('设备名称'),
          align: 'center',
          dataIndex: 'deviceName',
        },
        {
          title: this.$t('设备类型'),
          align: 'center',
          dataIndex: 'deviceType_dictText',
        },
        {
          title: this.$t('笔数'),
          align: 'right',
          dataIndex: 'count',
          customRender: (text, r) => {
            return text.toFixed(0);
          }
        },
        {
          title: this.$t('出币值'),
          align: 'right',
          dataIndex: 'amount',
          customRender: (text, r) => {
            return text.toFixed(0);
          }
        },
      ],
      outCoinDataSource: [],
      saveLotteryColumns: [
        {
          title: this.$t('设备编码'),
          align: 'center',
          dataIndex: 'deviceId',
          customRender:(t,r)=>{
            if(t=='合计'){
              return this.$t(t)
            }
            return t
          }
        },
        {
          title: this.$t('设备名称'),
          align: 'center',
          dataIndex: 'deviceName',
        },
        {
          title: this.$t('设备类型'),
          align: 'center',
          dataIndex: 'deviceType_dictText',
        },
        {
          title: this.$t('存币次数'),
          align: 'center',
          dataIndex: 'coinCount',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
          customRender: (text, r) => {
            text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
            return text.toFixed(0);
          }
        },
        {
          title: this.$t('存币值'),
          align: 'center',
          dataIndex: 'coin',
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
          customRender: (text, r) => {
            text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
            return text.toFixed(2);
          }
        },
        {
          title: this.$t('存票次数'),
          align: 'center',
          dataIndex: 'lotteryCount',
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
          customRender: (text, r) => {
            text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
            return text.toFixed(0);
          }
        },
        {
          title: this.$t('存票值'),
          align: 'center',
          dataIndex: 'lottery',
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
          customRender: (text, r) => {
            text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
            return text.toFixed(0);
          }
        },
      ],
      saveLotteryDataSource: [],
      giftRecycleColumns: [
        {
          title: this.$t('商品编码'),
          align: 'center',
          dataIndex: 'goodsCode',
        },
        {
          title: this.$t('商品名称'),
          align: 'center',
          dataIndex: 'goodsName',
          customRender: (t, r) => {
            if (t == '合计') {
              return this.$t(t)
            }
            return t
          },
        },
        {
          title: this.$t('商品分类'),
          align: 'center',
          dataIndex: 'goodsKindName',
        },
        {
          title: this.$t('回收币'),
          align: 'center',
          children: [
            {
              title: this.$t('数量'),
              align: 'center',
              dataIndex: 'coinNumber',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
            {
              title: this.$t('币值'),
              align: 'center',
              dataIndex: 'coin',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(2);
              }
            },
          ],
        },
        {
          title: this.$t('回收彩票'),
          align: 'center',
          children: [
            {
              title: this.$t('数量'),
              align: 'center',
              dataIndex: 'lotteryNumber',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
            {
              title: this.$t('彩票'),
              align: 'center',
              dataIndex: 'lottery',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
          ],
        },
        {
          title: this.$t('回收积分'),
          align: 'center',
          children: [
            {
              title: this.$t('数量'),
              align: 'center',
              dataIndex: 'integralNumber',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
            {
              title: this.$t('积分'),
              align: 'center',
              dataIndex: 'integral',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
          ],
        },
        {
          title: this.$t('回收A票'),
          align: 'center',
          children: [
            {
              title: this.$t('数量'),
              align: 'center',
              dataIndex: 'alotteryNumber',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
            {
              title: this.$t('A票'),
              align: 'center',
              dataIndex: 'alottery',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
          ],
        },
        {
          title: this.$t('回收A币'),
          align: 'center',
          children: [
            {
              title: this.$t('数量'),
              align: 'center',
              dataIndex: 'acoinNumber',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
            {
              title: this.$t('A币'),
              align: 'center',
              dataIndex: 'acoin',
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
              customRender: (text, r) => {
                text = (text ==null || text =="" || text ==undefined)?0:parseFloat(text);
                return text.toFixed(0);
              }
            },
          ],
        }
      ],
      giftRecycleDataSource: [],
      goodsKindColumns: [
        {
          title: this.$t('分类编码'),
          align: 'center',
          dataIndex: 'kindCode',
          customRender:(t,r)=>{
            if(t=='合计'){
              return this.$t(t)
            }
            return t
          }
        },
        {
          title: this.$t('分类名称'),
          align: 'center',
          dataIndex: 'kindName',
        },
        {
          title: this.$t('业务笔数'),
          align: 'center',
          dataIndex: 'count',
          customCell: (r, i) => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('成本'),
          align: 'center',
          dataIndex: 'cost',
          customRender: (t) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(4)
          },
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('销售金额'),
          align: 'center',
          dataIndex: 'totle',
          customRender: (t) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('利润'),
          align: 'center',
          dataIndex: 'profit',
          customRender: (t) => {
            if (!t) {
              t = 0
            }
            return t.toFixed(2)
          },
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
        {
          title: this.$t('利润占比'),
          align: 'center',
          dataIndex: 'ratio',
          customRender: (t,r) => {
            if(!t){
              return ''
            }
            return t + '%'
          },
          customCell: () => {
            return {
              style: {
                textAlign: 'right',
              },
            }
          },
        },
      ],
      goodsKindDataSource: [],
    }    
  },
  methods:{
    ...mapGetters(['nickname', 'avatar', 'userInfo']),
    customRow(r, i) {
      return {
        style: {
          fontWeight:
            r.deviceId == this.$t('合计') || r.typeId_dictText == this.$t('合计') || r.goodsForm == this.$t('合计') ? 700 : 400,
        },
      }
    },
    customRow1(r, i) {
      return {
        style: {
          fontWeight: !r.gameId ? 700 : 400,
        },
      }
    },
    show(obj) {
      let that = this
      that.visible = true
      that.queryParam = obj.queryParam
      that.modules = obj.modules
      that.equipmentCollectionColumns = obj.equipmentCollectionColumns
      that.equipmentCollectionDataSource = obj.equipmentCollectionDataSource
      that.businessSummaryColumns = obj.businessSummaryColumns
      that.businessSummaryDataSource = obj.businessSummaryDataSource
      that.goodsSalesColumns = obj.goodsSalesColumns
      that.goodsSalesDataSource = obj.goodsSalesDataSource
      that.machineOnOffColumns = obj.machineOnOffColumns
      that.machineOnOffDataSource = obj.machineOnOffDataSource
      that.ticketProjectColumns = obj.ticketProjectColumns
      that.ticketProjectDataSource = obj.ticketProjectDataSource
      that.balanceChangesColumns = obj.balanceChangesColumns
      that.balanceChangesDataSource = obj.balanceChangesDataSource
      that.memberMealColumns = obj.memberMealColumns
      that.memberMealDataSource = obj.memberMealDataSource
      that.outCoinColumns = obj.outCoinColumns
      that.outCoinDataSource = obj.outCoinDataSource
      that.saveLotteryColumns = obj.saveLotteryColumns
      that.saveLotteryDataSource = obj.saveLotteryDataSource
      that.giftRecycleColumns = obj.giftRecycleColumns
      that.giftRecycleDataSource = obj.giftRecycleDataSource
      that.goodsKindColumns = obj.goodsKindColumns
      that.goodsKindDataSource = obj.goodsKindDataSource
    },
    handleCancel(){
      this.visible = false
    }
  }
}
</script>

<style>
@media print {
  html,body{
    height: inherit
  }
}
</style>